#pragma once
#ifndef SYPX_AUDIOENGINE
#define SYPX_AUDIOENGINE

#include "Base.h"
#include "Types.h"
#include "SoundBuffer.h"

namespace SypX
{
	class SYPXAPI AudioEngine
	{
	public:		
		AudioEngine(void);
		virtual ~AudioEngine(void);
		///Initialises a soundbuffer and returns the bufferID. (Not to be called by User)
		virtual UInt createSoundBuffer()=0;
		///Loads a wav file and returns it in a SoundBuffer
		virtual SoundBuffer* loadFromWAVFile(const String& name)=0;
		///Plays the sound from SoundBuffer at pos
		virtual void playSound(SoundBuffer* snd, const Vec3& pos )=0;
		///Deletes the soundbuffer in Sound memory (Not to be called by User)
		virtual void deleteSoundBuffer(SoundBuffer* snd)=0;
		///Sets the position of the listener
		void setListenerPos(const Vec3& pos);
		///Plays a background music file (Only works on iPhone for now)
		///Due to hardware constraints on iPhone, only 1 background music can be played by hardware
		///All sound effects should use SoundBuffers and playSound
		virtual void playMusic(const String& file, bool loop = true)=0;
		///Stops currently playing Music
		virtual void stopMusic()=0;
	protected:
		Vec3 listenerPos;

	};

}
#endif